home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "NT Security Test"
- ClientHeight = 6300
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4890
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6300
- ScaleWidth = 4890
- StartUpPosition = 3 'Windows Default
- Begin VB.Frame Frame1
- Caption = "Domain Information"
- Height = 5115
- Left = 120
- TabIndex = 3
- Top = 1140
- Width = 4635
- Begin VB.CommandButton Command2
- Caption = "Set"
- Height = 315
- Index = 4
- Left = 1200
- TabIndex = 25
- Top = 4680
- Width = 435
- End
- Begin VB.CommandButton Command2
- Caption = "Set"
- Height = 315
- Index = 3
- Left = 4140
- TabIndex = 24
- Top = 4320
- Width = 435
- End
- Begin VB.CommandButton Command2
- Caption = "Set"
- Height = 315
- Index = 2
- Left = 4140
- TabIndex = 23
- Top = 3960
- Width = 435
- End
- Begin VB.CommandButton Command2
- Caption = "Set"
- Height = 315
- Index = 1
- Left = 4140
- TabIndex = 22
- Top = 3600
- Width = 435
- End
- Begin VB.CommandButton Command2
- Caption = "Set"
- Height = 315
- Index = 0
- Left = 4140
- TabIndex = 21
- Top = 3240
- Width = 435
- End
- Begin VB.TextBox Text2
- Height = 315
- Index = 3
- Left = 1560
- TabIndex = 20
- Text = "<None>"
- Top = 4320
- Width = 2535
- End
- Begin VB.TextBox Text2
- Height = 315
- Index = 2
- Left = 1560
- TabIndex = 19
- Text = "<None>"
- Top = 3960
- Width = 2535
- End
- Begin VB.TextBox Text2
- Height = 315
- Index = 1
- Left = 1560
- TabIndex = 18
- Text = "<None>"
- Top = 3600
- Width = 2535
- End
- Begin VB.TextBox Text2
- Height = 315
- Index = 0
- Left = 1560
- TabIndex = 17
- Text = "<None>"
- Top = 3240
- Width = 2535
- End
- Begin VB.CheckBox Check2
- Caption = "Locked"
- Enabled = 0 'False
- Height = 195
- Left = 2400
- TabIndex = 16
- Top = 4740
- Width = 1455
- End
- Begin VB.CheckBox Check1
- Caption = "Disabled"
- Height = 195
- Left = 180
- TabIndex = 15
- Top = 4740
- Width = 1215
- End
- Begin VB.ListBox List2
- Height = 1815
- Left = 2400
- TabIndex = 9
- Top = 1020
- Width = 1995
- End
- Begin VB.ListBox List1
- Height = 1815
- Left = 180
- TabIndex = 7
- Top = 1020
- Width = 1995
- End
- Begin VB.Label Label6
- Caption = "Login Script:"
- Height = 195
- Index = 4
- Left = 180
- TabIndex = 14
- Top = 4380
- Width = 1335
- End
- Begin VB.Label Label6
- Caption = "Home Directory:"
- Height = 195
- Index = 3
- Left = 180
- TabIndex = 13
- Top = 4020
- Width = 1335
- End
- Begin VB.Label Label6
- Caption = "Comment:"
- Height = 195
- Index = 2
- Left = 180
- TabIndex = 12
- Top = 3660
- Width = 1335
- End
- Begin VB.Label Label6
- Caption = "Full Name:"
- Height = 195
- Index = 1
- Left = 180
- TabIndex = 11
- Top = 3300
- Width = 1335
- End
- Begin VB.Label Label6
- Caption = "Current User Information:"
- Height = 195
- Index = 0
- Left = 180
- TabIndex = 10
- Top = 2940
- Width = 3075
- End
- Begin VB.Label Label5
- Caption = "Users in selected group:"
- Height = 195
- Left = 2400
- TabIndex = 8
- Top = 780
- Width = 1935
- End
- Begin VB.Label Label4
- Caption = "Groups in domain:"
- Height = 195
- Left = 180
- TabIndex = 6
- Top = 780
- Width = 1935
- End
- Begin VB.Label Label3
- Caption = "<None>"
- Height = 315
- Left = 2460
- TabIndex = 5
- Top = 360
- Width = 2115
- End
- Begin VB.Label Label2
- Caption = "Primary Domain Controller:"
- Height = 315
- Left = 180
- TabIndex = 4
- Top = 360
- Width = 2055
- End
- End
- Begin VB.CommandButton Command1
- Caption = "Get Info"
- Default = -1 'True
- Height = 495
- Left = 3300
- TabIndex = 2
- Top = 240
- Width = 1215
- End
- Begin VB.TextBox Text1
- Height = 315
- Left = 180
- TabIndex = 1
- Text = "<Enter the name of your domain>"
- Top = 540
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Enter the name of the domain to use:"
- Height = 255
- Left = 180
- TabIndex = 0
- Top = 180
- Width = 2715
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Global variables
- Dim MyDomain As New NTDomain
- Private Sub Command1_Click()
- Dim MyList() As String, i As Integer
- ' Clear up any existing information
- List1.Clear
- List2.Clear
- Label3.Caption = "<None>"
- For i = 0 To 3
- Text2(i) = "<None>"
- Next i
- Check1 = False
- Check2 = False
-
- ' Now get new information
- MyDomain.sDomain = Text1.Text
- If MyDomain.sLastError = "SUCCESS" Then
- ' Display PDC
- Label3.Caption = MyDomain.sDC
- MyDomain.Groups.Enumerate MyList
- ' Add list of groups to the listbox
- For i = 1 To UBound(MyList)
- List1.AddItem MyList(i)
- Next i
- End If
- End Sub
- Private Sub Command2_Click(Index As Integer)
- ' Set the appropriate property
- Select Case Index
- Case 0
- MyDomain.Groups.Users.sFullName = Text2(0)
- Case 1
- MyDomain.Groups.Users.sComment = Text2(1)
- Case 2
- MyDomain.Groups.Users.sHomeDir = Text2(2)
- Case 3
- MyDomain.Groups.Users.sScriptPath = Text2(3)
- Case 4
- MyDomain.Groups.Users.bDisabled = (Check1.Value = 1)
- End Select
- ' Did it work?
- If MyDomain.Groups.Users.sLastError <> "SUCCESS" Then Debug.Print MyDomain.Groups.Users.sLastError
- End Sub
- Private Sub Form_Load()
- ' Center
- Left = (Screen.Width - Me.Width) \ 2
- Top = (Screen.Height - Me.Height) \ 2
- End Sub
- Private Sub List1_Click()
- Dim MyList() As String, i As Integer
- ' Clean up existing stuff
- List2.Clear
- For i = 0 To 3
- Text2(i) = "<None>"
- Next i
- Check1 = False
- Check2 = False
- ' Set current group
- MyDomain.Groups.sGroupName = List1.Text
- If MyDomain.Groups.sLastError = "SUCCESS" Then
- ' Get users in group
- MyDomain.Groups.Users.Enumerate MyList
- For i = 1 To UBound(MyList)
- List2.AddItem MyList(i)
- Next i
- End If
- End Sub
- Private Sub List2_Click()
- Dim i As Integer
- ' Clear current stuff
- For i = 0 To 3
- Text2(i) = "<None>"
- Next i
- Check1 = False
- Check2 = False
- ' Set current user
- MyDomain.Groups.Users.sUserName = List2.Text
- If MyDomain.Groups.Users.sLastError = "SUCCESS" Then
- With MyDomain.Groups.Users
- Text2(0) = .sFullName
- Text2(1) = .sComment
- Text2(2) = .sHomeDir
- Text2(3) = .sScriptPath
- If .bDisabled Then Check1.Value = 1
- If .bLockedOut Then Check2.Value = 1
- End With
- End If
- End Sub
-